
; Hook
; also known as the "rope"
; sticks to things and pulls the player towards it


(load "weapon.scm")

(define hook%
  (class weapon%
    
    ; PHYSICS-OBJECT% 
    (inherit-field velocity
                   collision-occured)
    ; PRIVATE VARIABLES
    (define release #f)
    (define stuck   #f)
    
    ; Update
    (define/override (update)
      (when collision-occured
        (set! stuck #t)
        (set! velocity (vector #i0 #i0)))
      (not release))
    
    ; Release
    (define/public (release-hook)
      (set! release #t))
    
    ; Stuck
    (define/public (stuck?)
      stuck)
    
    ; Constructor/Initialization
    (super-new [bounce #f] [weapon-name "hook"] [weapon-speed #i500] [damage 2])))



